package com.gitee.chili.leisure;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Random;

/**
 * Tools
 *
 * @author week solider
 * @since 2020.09.07
 */
public class Tools {


    /**
     * 元转分
     *
     * @param score 需要转换的数值
     */
    public static Long rmbCast(BigDecimal score) {
        BigDecimal decimal = score.multiply(new BigDecimal("100"));
        return decimal.setScale(0, RoundingMode.DOWN).longValue();
    }

    /**
     * 摇色子 (1-6)
     */
    public static int shaker() {
        Random random = new Random();
        return random.nextInt(5) + 1;
    }
}
